#Replace all substrings of more than 1 space (2 or more spaces) with a line break

dataFile = "file to reformat line breaks.txt"
outFile = "with line breaks3.txt"

txtStream = open(dataFile)
outStream = open(outFile,'w')
txt = txtStream.read()
maxlength = txt.__len__()

for concatSpaces in range(maxlength,1,-1):
    txt = txt.replace(concatSpaces * " ","\n")

outStream.write(txt)

txtStream.close()
outStream.close()
